<template>
	<view class="tabulation">
		<diyNavBar value='记录列表' :color="'#FF6F30'"></diyNavBar>
		<view class="item" v-for="(item,index) in list" :key="index">
			<text>{{item.task_name}}</text>
			<view class="right">
				<view v-if="type=='tabulation'">
					<text v-if="item.status == 1">生效中</text>
					<text v-if="item.status == 2">失效</text>
				</view>
				<text v-else>置顶时间：{{item.num}}小时</text>
				<!-- <text>{{$util.timestampToTime(item.create_time)}}</text> -->
			</view>
		</view>
		<loading-cover ref="loadingCover"></loading-cover>
	</view>
</template>

<script>
	import diyNavBar from '../../component/diy-nav/diy-navbar.vue'
	import loadingCover from '../../component/loading-cover/loading-cover.vue'
	export default {
		components: {
			diyNavBar,
			loadingCover
		},
		data(){
			return {
				list:[],
				type:'tabulation'
			}
		},
		onLoad(option) {
			this.getData(option.type);
		},
		methods:{
			getData(type){
				let url = '/ToppingRecord/ToppingRecordList';
				if(type == 'tabulation') url ='/RefreshTask/RefreshRecordList'; 
				this.$http.sendrequest(url).then((res)=>{
					this.list = res.data;
					this.$refs.loadingCover.hide();
				})
			}
		}
	}
</script>
 
<style lang="scss" scoped>
	.tabulation{
		min-height: 100vh;
		background: $uni-content-background-color;
		font-family: Arial;
	}
	.item{
		margin: 0 30rpx;
		padding: 0 20rpx;
		height: 80rpx;
		display: flex;
		align-items: center;
		justify-content: space-between;
		box-sizing: border-box;
		font-size: 26rpx;
		background: #fff;
		border-radius: 10rpx;
		margin-top: 30rpx;
		.right{
			font-size: 26rpx;
			text{
				margin-left:30rpx;
				color: red;
			}
			text:nth-child(2){
			}
		}
	}
</style>